<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        let promise = new Promise(function(resolve, reject){
            console.log('创建Promise对象')
            // resolve('success')
            // reject('fail')
            throw new Error('anything error')
        })

        promise.then(
            function(data) {
                console.log('执行成功，执行结果为：' + data)
            },
            function(data) {
                console.log('执行失败，执行结果为：' + data)
            }
        ).catch(function(data){
            console.log('出现异常了，异常为：' + data)
        })

        console.log('代码一继续运行....')
        console.log('代码二继续运行....')
    </script>
</head>
<body>
    
</body>
</html>